.class public final Lnet/tsapps/topdeals/c/m;
.super Ljava/lang/Object;


# instance fields
.field a:Lnet/tsapps/topdeals/c/l;

.field private b:Lnet/tsapps/topdeals/f/a;

.field private c:Lnet/tsapps/topdeals/f/c;

.field private d:Landroid/widget/LinearLayout;

.field private e:J

.field private f:Lnet/tsapps/topdeals/c/g;


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/widget/LinearLayout;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Lnet/tsapps/topdeals/f/a;

    invoke-direct {v0}, Lnet/tsapps/topdeals/f/a;-><init>()V

    iput-object v0, p0, Lnet/tsapps/topdeals/c/m;->b:Lnet/tsapps/topdeals/f/a;

    new-instance v0, Lnet/tsapps/topdeals/c/l;

    invoke-direct {v0, p0}, Lnet/tsapps/topdeals/c/l;-><init>(Lnet/tsapps/topdeals/c/m;)V

    iput-object v0, p0, Lnet/tsapps/topdeals/c/m;->a:Lnet/tsapps/topdeals/c/l;

    new-instance v0, Lnet/tsapps/topdeals/c/g;

    invoke-direct {v0, p0}, Lnet/tsapps/topdeals/c/g;-><init>(Lnet/tsapps/topdeals/c/m;)V

    iput-object v0, p0, Lnet/tsapps/topdeals/c/m;->f:Lnet/tsapps/topdeals/c/g;

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->f:Lnet/tsapps/topdeals/c/g;

    const/4 v1, 0x4

    invoke-virtual {v0, v1}, Lnet/tsapps/topdeals/c/g;->setPriority(I)V

    new-instance v0, Lnet/tsapps/topdeals/f/c;

    const/4 v1, 0x0

    invoke-direct {v0, p1, v1}, Lnet/tsapps/topdeals/f/c;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v0, p0, Lnet/tsapps/topdeals/c/m;->c:Lnet/tsapps/topdeals/f/c;

    iput-object p2, p0, Lnet/tsapps/topdeals/c/m;->d:Landroid/widget/LinearLayout;

    return-void
.end method

.method private static a(Ljava/io/File;)Landroid/graphics/Bitmap;
    .locals 6

    const/16 v5, 0x12c

    const/4 v1, 0x1

    const/4 v0, 0x0

    :try_start_0
    new-instance v3, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v3}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    const/4 v2, 0x1

    iput-boolean v2, v3, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    new-instance v2, Ljava/io/FileInputStream;

    invoke-direct {v2, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    const/4 v4, 0x0

    invoke-static {v2, v4, v3}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    iget v2, v3, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    iget v3, v3, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    :goto_0
    div-int/lit8 v4, v2, 0x2

    if-lt v4, v5, :cond_0

    div-int/lit8 v4, v3, 0x2

    if-lt v4, v5, :cond_0

    div-int/lit8 v2, v2, 0x2

    div-int/lit8 v3, v3, 0x2

    mul-int/lit8 v1, v1, 0x2

    goto :goto_0

    :cond_0
    new-instance v2, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v2}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    iput v1, v2, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    new-instance v1, Ljava/io/FileInputStream;

    invoke-direct {v1, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    const/4 v3, 0x0

    invoke-static {v1, v3, v2}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_1
    return-object v0

    :catch_0
    move-exception v1

    goto :goto_1
.end method

.method private a(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 3

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->c:Lnet/tsapps/topdeals/f/c;

    invoke-virtual {v0, p1}, Lnet/tsapps/topdeals/f/c;->a(Ljava/lang/String;)Ljava/io/File;

    move-result-object v1

    invoke-static {v1}, Lnet/tsapps/topdeals/c/m;->a(Ljava/io/File;)Landroid/graphics/Bitmap;

    move-result-object v0

    if-eqz v0, :cond_0

    :goto_0
    return-object v0

    :cond_0
    :try_start_0
    new-instance v0, Ljava/net/URL;

    invoke-direct {v0, p1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v0

    check-cast v0, Ljava/net/HttpURLConnection;

    const/16 v2, 0x7530

    invoke-virtual {v0, v2}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    const/16 v2, 0x7530

    invoke-virtual {v0, v2}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V

    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v0

    new-instance v2, Ljava/io/FileOutputStream;

    invoke-direct {v2, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    invoke-static {v0, v2}, Lnet/tsapps/topdeals/f/b;->a(Ljava/io/InputStream;Ljava/io/OutputStream;)V

    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V

    invoke-static {v1}, Lnet/tsapps/topdeals/c/m;->a(Ljava/io/File;)Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    const/4 v0, 0x0

    goto :goto_0
.end method

.method static synthetic a(Lnet/tsapps/topdeals/c/m;Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 1

    invoke-direct {p0, p1}, Lnet/tsapps/topdeals/c/m;->a(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    return-object v0
.end method

.method static synthetic a(Lnet/tsapps/topdeals/c/m;)Lnet/tsapps/topdeals/f/a;
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->b:Lnet/tsapps/topdeals/f/a;

    return-object v0
.end method

.method static synthetic b(Lnet/tsapps/topdeals/c/m;)J
    .locals 2

    iget-wide v0, p0, Lnet/tsapps/topdeals/c/m;->e:J

    return-wide v0
.end method

.method static synthetic c(Lnet/tsapps/topdeals/c/m;)Landroid/widget/LinearLayout;
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->d:Landroid/widget/LinearLayout;

    return-object v0
.end method


# virtual methods
.method public final a()V
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->f:Lnet/tsapps/topdeals/c/g;

    invoke-virtual {v0}, Lnet/tsapps/topdeals/c/g;->interrupt()V

    return-void
.end method

.method public final a(Ljava/lang/String;Landroid/widget/ImageView;)V
    .locals 6

    const/16 v3, 0x8

    const/4 v2, 0x0

    new-instance v0, Ljava/util/Date;

    invoke-direct {v0}, Ljava/util/Date;-><init>()V

    invoke-virtual {v0}, Ljava/util/Date;->getTime()J

    move-result-wide v0

    iput-wide v0, p0, Lnet/tsapps/topdeals/c/m;->e:J

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->b:Lnet/tsapps/topdeals/f/a;

    invoke-virtual {v0, p1}, Lnet/tsapps/topdeals/f/a;->a(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    if-eqz v0, :cond_1

    invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->d:Landroid/widget/LinearLayout;

    invoke-virtual {v0, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

    invoke-virtual {p2, v2}, Landroid/widget/ImageView;->setVisibility(I)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {p2, v3}, Landroid/widget/ImageView;->setVisibility(I)V

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->d:Landroid/widget/LinearLayout;

    invoke-virtual {v0, v2}, Landroid/widget/LinearLayout;->setVisibility(I)V

    new-instance v0, Ljava/util/Date;

    invoke-direct {v0}, Ljava/util/Date;-><init>()V

    invoke-virtual {v0}, Ljava/util/Date;->getTime()J

    move-result-wide v4

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->a:Lnet/tsapps/topdeals/c/l;

    invoke-virtual {v0, p2}, Lnet/tsapps/topdeals/c/l;->a(Landroid/widget/ImageView;)V

    new-instance v0, Lnet/tsapps/topdeals/c/c;

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    invoke-direct/range {v0 .. v5}, Lnet/tsapps/topdeals/c/c;-><init>(Lnet/tsapps/topdeals/c/m;Ljava/lang/String;Landroid/widget/ImageView;J)V

    iget-object v1, p0, Lnet/tsapps/topdeals/c/m;->a:Lnet/tsapps/topdeals/c/l;

    invoke-static {v1}, Lnet/tsapps/topdeals/c/l;->a(Lnet/tsapps/topdeals/c/l;)Ljava/util/Stack;

    move-result-object v1

    monitor-enter v1

    :try_start_0
    iget-object v2, p0, Lnet/tsapps/topdeals/c/m;->a:Lnet/tsapps/topdeals/c/l;

    invoke-static {v2}, Lnet/tsapps/topdeals/c/l;->a(Lnet/tsapps/topdeals/c/l;)Ljava/util/Stack;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/util/Stack;->push(Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->a:Lnet/tsapps/topdeals/c/l;

    invoke-static {v0}, Lnet/tsapps/topdeals/c/l;->a(Lnet/tsapps/topdeals/c/l;)Ljava/util/Stack;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->notifyAll()V

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->f:Lnet/tsapps/topdeals/c/g;

    invoke-virtual {v0}, Lnet/tsapps/topdeals/c/g;->getState()Ljava/lang/Thread$State;

    move-result-object v0

    sget-object v1, Ljava/lang/Thread$State;->NEW:Ljava/lang/Thread$State;

    if-ne v0, v1, :cond_0

    iget-object v0, p0, Lnet/tsapps/topdeals/c/m;->f:Lnet/tsapps/topdeals/c/g;

    invoke-virtual {v0}, Lnet/tsapps/topdeals/c/g;->start()V

    goto :goto_0

    :catchall_0
    move-exception v0

    :try_start_1
    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method
